package com.tensquare.notice;

import com.tensquare.notice.config.ApplicationContextProvider;
import com.tensquare.notice.netty.NettyServer;
import com.tensquare.util.IdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@MapperScan("com.tensquare.notice.dao")
public class NoticeApplication {


    public static void main(String[] args) {
        SpringApplication.run(NoticeApplication.class,args);
//        NettyServer server = ApplicationContextProvider.getApplicationContext().getBean(NettyServer.class);
//        server.start(12345);
    }

    @Bean
    public IdWorker idWorkker(){
        return new IdWorker(1, 1);
    }
}
